*** Settings ***
Suite Setup       Set Log Level    trace
Test Setup        One APP Login    &{appUser1}[name]    &{appUser1}[pwd]
Resource          ../../../Resources_Config.robot

*** Test Cases ***
用车指南点赞和取消点赞正常流程
    [Tags]    L0
    # 参数准备
    ${url}    Set Variable    ${car_knowledge_like_or_cancel}
    ${carKnowledgeId}    Set Variable    56
    ${h5UserId}    Set Variable    0
    ##步骤1：用车指南点赞
    #构造请求体
    ${postdata}    Create Dictionary    carKnowledgeId=${carKnowledgeId}    h5UserId=${h5UserId}    isLiked=${False}
    #下发请求
    ${rsp}    Post Request    ${url}    ${postdata}
    Should Be Equal As Strings    ${rsp['code']}    ${200}
    Should Be Equal As Strings    ${rsp['body']['returnStatus']}    SUCCEED
    ##步骤2：用车指南取消点赞
    #构造请求体
    ${postdata}    Create Dictionary    carKnowledgeId=${carKnowledgeId}    h5UserId=${h5UserId}    isLiked=${True}
    #下发请求
    ${rsp}    Post Request    ${url}    ${postdata}
    Should Be Equal As Strings    ${rsp['code']}    ${200}
    Should Be Equal As Strings    ${rsp['body']['returnStatus']}    SUCCEED
